﻿namespace Sidvall.WorkItemManager.Data.Entity.Entities
{
    public partial class WorkItemWorkCondition : global::Sidvall.Data.DataRowBase, global::Sidvall.WorkItemManager.Data.IWorkItemWorkCondition
    {
        #region Public Members

        #region ConditionContext

        private string _ConditionContext;
        public string ConditionContext
        { 
            get
            {
                return _ConditionContext;
            }
            set
            {
                _ConditionContext = value;
            }
        }

        #endregion
        #region GroupId

        private string _GroupId;
        public string GroupId
        { 
            get
            {
                return _GroupId;
            }
            set
            {
                _GroupId = value;
            }
        }

        #endregion
        #region InvalidAction

        private int _InvalidAction;
        public int InvalidAction
        { 
            get
            {
                return _InvalidAction;
            }
            set
            {
                _InvalidAction = value;
            }
        }

        #endregion
        #region IsEnabled

        private bool _IsEnabled;
        public bool IsEnabled
        { 
            get
            {
                return _IsEnabled;
            }
            set
            {
                _IsEnabled = value;
            }
        }

        #endregion
        #region IsEnabledOnRetry

        private bool _IsEnabledOnRetry;
        public bool IsEnabledOnRetry
        { 
            get
            {
                return _IsEnabledOnRetry;
            }
            set
            {
                _IsEnabledOnRetry = value;
            }
        }

        #endregion
        #region WorkConditionId

        private long _WorkConditionId;
        public long WorkConditionId
        { 
            get
            {
                return _WorkConditionId;
            }
            set
            {
                _WorkConditionId = value;
            }
        }

        #endregion
        #region WorkItemId

        private long _WorkItemId;
        public long WorkItemId
        { 
            get
            {
                return _WorkItemId;
            }
            set
            {
                _WorkItemId = value;
            }
        }

        #endregion
        
        public virtual Sidvall.WorkItemManager.Data.Entity.Entities.WorkCondition WorkCondition { get; set; }
        public virtual Sidvall.WorkItemManager.Data.Entity.Entities.WorkItem WorkItem { get; set; }
        
        #region DataRowContextStorageKey

        protected override string DataRowContextStorageKey
        {
            get
            {
                return global::Sidvall.WorkItemManager.Data.Entity.SystemContext.Current.EntityFacade.WorkItemWorkConditionManager.GetKey(this);
            }
        }

        #endregion
        #region DataRowStateIsDirty

        protected override bool DataRowStateIsDirty
        {
            get
            {
                return global::Sidvall.WorkItemManager.Data.Entity.SystemContext.Current.EntityFacade.WorkItemWorkConditionManager.DataRowStateIsDirty(this);
            }
        }

        #endregion

        #region IWorkItemWorkCondition Members

        string global::Sidvall.WorkItemManager.Data.IWorkItemWorkCondition.ConditionContext
        {
            get
            {
                return this._ConditionContext;
            }
            set
            {
                this.ConditionContext = value;
            }
        }
        string global::Sidvall.WorkItemManager.Data.IWorkItemWorkCondition.GroupId
        {
            get
            {
                return this._GroupId;
            }
            set
            {
                this.GroupId = value;
            }
        }
        global::Sidvall.WorkItemManager.Workflow.ThreadAction global::Sidvall.WorkItemManager.Data.IWorkItemWorkCondition.InvalidAction
        {
            get
            {
                return (global::Sidvall.WorkItemManager.Workflow.ThreadAction)this._InvalidAction;
            }
            set
            {
                this.InvalidAction = (int)value;
            }
        }
        bool global::Sidvall.WorkItemManager.Data.IWorkItemWorkCondition.IsEnabled
        {
            get
            {
                return this._IsEnabled;
            }
            set
            {
                this.IsEnabled = value;
            }
        }
        bool global::Sidvall.WorkItemManager.Data.IWorkItemWorkCondition.IsEnabledOnRetry
        {
            get
            {
                return this._IsEnabledOnRetry;
            }
            set
            {
                this.IsEnabledOnRetry = value;
            }
        }
        long global::Sidvall.WorkItemManager.Data.IWorkItemWorkCondition.WorkConditionId
        {
            get
            {
                return this._WorkConditionId;
            }
            set
            {
                this.WorkConditionId = value;
            }
        }
        long global::Sidvall.WorkItemManager.Data.IWorkItemWorkCondition.WorkItemId
        {
            get
            {
                return this._WorkItemId;
            }
            set
            {
                this.WorkItemId = value;
            }
        }
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
        IWorkCondition global::Sidvall.WorkItemManager.Data.IWorkItemWorkCondition.WorkCondition
        {
            get
            {
                return this.WorkCondition;
            }
            set
            {
                this.WorkCondition = value as WorkCondition;
            }
        }
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
        IWorkItem global::Sidvall.WorkItemManager.Data.IWorkItemWorkCondition.WorkItem
        {
            get
            {
                return this.WorkItem;
            }
            set
            {
                this.WorkItem = value as WorkItem;
            }
        }

        #endregion

        #endregion
        #region Constructors

        public WorkItemWorkCondition() : this(false, null, null)
        {
        }
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
        public WorkItemWorkCondition(bool initializeChildren, Sidvall.Data.IDataRowContextProvider context, Sidvall.Data.DataRowState? dataRowState)
        {
            if ((context != null) || (dataRowState != null))
                SetDataRowContext(context, dataRowState);
            if (initializeChildren)
            {
            }
        }

        #endregion
    }
}